# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=Net-DNS
pkgname=perl-${_realname}
pkgver=1.16
pkgrel=1
pkgdesc="Perl Module: Interface to the DNS resolver."
arch=('i686' 'x86_64')
license=('PerlArtistic')
url="http://search.cpan.org/dist/${_realname}/"
groups=('perl-modules')
depends=('perl-Digest-HMAC' 'perl-Net-IP' 'perl')
checkdepends=('perl-Test-Pod')
options=('!emptydirs')
source=("https://www.cpan.org/authors/id/N/NL/NLNETLABS/${_realname}-${pkgver}.tar.gz")
sha256sums=('8163eebaf46d1a870b6f596684f345da7c3a7461d7dba2b85f23e02d8982ea37')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  # install module in vendor directories.
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR="${pkgdir}"
}

